home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 001a / add_tm_d.zip / REPLAC20.DOC < prev    next >
Text File  |  1988-01-14  |  6KB  |  123 lines

  1. REPLACE ver 2.0  Copyright (C) 1986,1987,1988, RainTree Computer Systems
  2.                            All Rights Reserved.
  3.  
  4.                                -- REPLACE --
  5.  
  6. Program Description:
  7. This program searches an input file for a defined string and replaces it with
  8. a new string as it copies the input file to the output.  It operates in
  9. either of two modes:  filter or utility.  As a filter it gets its input from
  10. the redirected Standard Input file (STDIN), and sends its output to the
  11. Standard Output file (STDOUT).  It requires file redirection symbols for this
  12. mode of operation.  Operating as a filter only one file can be input with its
  13. output redirected to any directory and filename.  It is completely compatible
  14. with DOS redirection philosophy including piping.  To count the occurance of
  15. a string in an input file, redirect the output to the system file NUL.
  16.  
  17. In the utility mode an input file may be specified which includes DOS
  18. wildcards in the filename.  In this form of operation multiple files may be
  19. processed in a single execution of the program.  In addition to specifying an
  20. input file the utility operation requires that an output directory be
  21. specified for the destination location of the output file(s).  The name of
  22. output files in utility mode is always the same as its corresponding input
  23. file name.  To count the occurance of a string in the specified input files,
  24. simply do not specify the output destination directory.
  25.  
  26. Finally, please note that this program manages the strings as binary data.
  27. This means it may be used to modify non-text files such as program files,
  28. recognizing the considerable understanding required in this regard.
  29.  
  30.  
  31. Statment Syntax:
  32. Filter:   REPLACE  "Old_String"  "New_String"  /c /s  <infile     >outfile
  33. Utility:  REPLACE  "Old_String"  "New_String"  /c /s   infilemask  outdir
  34.  
  35. The first two parameters are the "Old_String" and "New_String".  They are the
  36. only required parameters.  The "New_String" must even be included as a nul
  37. parameter ("") when the old string is being deleted.  Both strings are
  38. enclosed with double quotes.  They must contain only ASCII characters, and
  39. the  \ddd decimal values or the  \sss synonyms to represent any non-ASCII
  40. (binary) values within the string.
  41.  
  42. \ddd - where ddd is any 3-digit decimal number from 000 through 255
  43.        representing a binary byte configuration or control character.
  44.  
  45. \sss - where sss is a word synonym for a corresponding byte value.  Synonyms
  46.        must always be written in UPPER CASE.
  47.  
  48.           Synonym - Definition                Synonym - Definition
  49.            \NULL  -  binary zero (ASCIIZ)      \ESC   -  escape
  50.            \BELL  -  bell                      \SPC   -  space (blank)
  51.            \BS    -  backspace                 \BLK   -  blank (space)
  52.            \HT    -  horizontal tab            \"     -  double quote
  53.            \LF    -  line feed                 \DQ    -  double quote
  54.            \VT    -  vertical tab              \'     -  single quote
  55.            \FF    -  forms feed                \SQ    -  single qote
  56.            \CR    -  carriage return           \\     -  single back slash
  57.            \EOF   -  end of file
  58.  
  59.  
  60. Switches:  must be separated by a blank.
  61.    /c  - Case sensitive:  upper and lower case characters compare unequal.
  62.            Default:  NOT case sensitive- upper and lower case compare equal.
  63.    /s  - Silent mode:  do not display anything on the screen; clean screen.
  64.  
  65.  
  66. Files:         Drive:\Paths\Filename       (Paths must already exist.)
  67. Filter operation; redirection symbols < > MUST preceed each file specification.
  68.    infile      The input file where the Old_String will be found.
  69.    outfile     The output file to be created with the New_String.
  70.  
  71. Utility Operation; redirection symbols are NOT valid here.
  72.    infilemask  Input file name supporting wildcards for multiple files.
  73.    outdir      Drive:\Directory  where the output files will be written.
  74.  
  75.  
  76. Filter Examples:
  77. -Add linefeeds to a file received by modem with only carriage returns.
  78.      REPLACE    "\CR"   "\CR\LF"            <myfile   >fixedfil
  79.      REPLACE    "\CR"   "\CR\LF"     /s     <myfile   >fixedfil
  80. -Delete a string:  specify the Old_String and no New_String.
  81.      REPLACE   "Old_String"    ""           <infile   >outfile
  82.      REPLACE   "Old_String"    ""    /c /s  <infile   >outfile
  83. -Count occurrences of a pattern by specifying a  >NUL output file.
  84.      REPLACE   "Old_String"    ""           <infile   >NUL
  85.      REPLACE   "Old_String"    ""    /c     <infile   >NUL
  86.  
  87. Utility Examples:
  88. -Add linefeeds to files received by modem with only carriage returns.
  89.      REPLACE    "\CR"   "\CR\LF"             *.txt      \tmp
  90.      REPLACE    "\CR"   "\CR\LF"     /s      *.txt      \tmp
  91. -Delete a string in multiple files:  specify the Old_String and no New_String.
  92.      REPLACE   "Old_String"    ""           \bat\*.bat  \newbat
  93.      REPLACE   "Old_String"    ""    /c /s  \bat\*.bat  \newbat
  94. -Count occurrences of a pattern by not specifying an output directory.
  95.      REPLACE   "Old_String"    ""           \doc\*.*
  96.      REPLACE   "Old_String"    ""    /c     \doc\*.*
  97.  
  98.  
  99. DOS Return Codes:
  100.         0 -replacements occurred       3 -parameters incorrectly specified
  101.         1 -no replacements occurred    4 -input file not found
  102.         2 -processed help request      5 -output directory not found
  103.  
  104.  
  105. License:
  106.      This program is protected by copyright.  It may be used and distributed
  107.      without charge.  It may NOT be combined with software or hardware, for
  108.      sale or for rent where the charge is over 7 dollars.
  109.                        THIS PROGRAM WARRANTS NOTHING.
  110.                ITS USE IS COMPLETELY AT THE USERS OWN RISK.
  111.  
  112. Shareware:
  113.      Do you use this program ?  If so why not make a $15. contribution to
  114.      support this method of software development and distribution.  All
  115.      for-profit and government organizations are required to make a $15.
  116.      payment per copy of this program for continued use after evaluation.
  117.  
  118.      Payments may be made to:  RainTree Computer Systems (REPLACE)
  119.                                P.O.Box 2401
  120.                                San Anselmo, CA 94960 USA
  121.  
  122.                                    ------
  123.